package org.lilred.nzbberry;

import org.lilred.nzbberry.controllers.AppController;
import org.lilred.nzbberry.plugin.BrowserPlugin;
import net.rim.device.api.browser.plugin.BrowserContentProviderRegistry;
import net.rim.device.api.ui.UiApplication;

public class Main extends UiApplication {
	
    public static void main(String[] args) throws Exception {
		if(args != null && args.length > 0) {
			if (args[0].equals("startup")) {
				//registerBrowserPlugin();
			}
		} else {
			UiApplication main = new Main();
			main.enterEventDispatcher();
		}
	}
    
    public Main() {
		//#ifndef BlackBerry4.7
		/*
		//#endif
    	int directions = net.rim.device.api.system.Display.DIRECTION_NORTH;
    	net.rim.device.api.ui.Ui.getUiEngineInstance().setAcceptableDirections(directions);
		//#ifndef BlackBerry4.7
		*/
		//#endif
    	AppController.getInstance();
    }
	
	private static void registerBrowserPlugin() {
		BrowserContentProviderRegistry converterRegistry = BrowserContentProviderRegistry.getInstance();
		if (converterRegistry != null) {   
			try {
				converterRegistry.register(new BrowserPlugin());
			}
			catch (Exception e) { System.out.println(e.getMessage()); }
		}
	}
}
